package com.sixth.volunteerservicesystem.Controller.DonationController.backDonation;

import com.sixth.volunteerservicesystem.Dao.DonationRecordsRepository;
import com.sixth.volunteerservicesystem.Dao.DonationRepository;
import com.sixth.volunteerservicesystem.domain.DonationProjects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Steve Jobs
 * @create 2021-01-11 1:08
 */
@Controller
public class DeleteDonation {

    @Autowired
    DonationRepository donationRepository;

    @RequestMapping("/deleteDonation/{id}")
    public String deleteDonation(@PathVariable("id") Integer id){

        donationRepository.deleteById(id);

        return "redirect:/backDonationList";
    }

}
